Skip to content

Format and clear analyzer errors for Mago 1.62.0 - #273

Merged
simon-mundy merged 1 commit into
php-db:0.6.xfrom
simon-mundy:qa/mago-1.62
Dec 1, 2026
Merged

simon-mundy merged 1 commit into
php-db:0.6.xfrom
simon-mundy:qa/mago-1.62

Conversation

@simon-mundy

Copy link
Copy Markdown
Member

phpdb-qa-tools now pins Mago 1.62.0. On 0.6.x it reformats 23 files and reports two new analyzer errors, which fails the Mago and mutation-testing jobs on every open PR (#267, #268, #269, #270, #272). Infection runs mago analyze as its static-analysis step, so the mutation job fails for the same reason.

  • Apply the 1.62.0 formatter (whitespace and alignment only).
  • Re-type the by-reference walk in AbstractSource::prepareDataHierarchy() as an array, which also makes its mixed-assignment pragma unused.
  • Expect docblock-type-mismatch and redundant-null-coalesce in AdapterInterfaceFactory: Mago resolves ServiceManager::get('config') through the class-string conditional return as object, though the config service is an array or null.
  • Drop an unused pragma in ParameterContainer and a redundant ?? null in Profiler::getLastProfile().
  • Remove 16 outdated analyzer baseline entries.

Three analyzer warnings remain and are left as is, since they do not fail the build and clearing them would change behaviour or public API: AbstractTableGateway::getLastInsertValue()'s return type, the iterator guard in AbstractResultSet, and the empty-join-name fallback in AbstractSql.

Checked locally with Mago 1.62.0: format, lint and analyze pass; PHPUnit passes (2874 tests); Infection passes at the CI thresholds (MSI 94.6%).

phpdb-qa-tools now pins Mago 1.62.0, which reformats 23 files and reports two new analyzer errors on 0.6.x, failing the Mago and mutation-testing jobs on every open PR.

- Apply the 1.62.0 formatter.
- Re-type the by-reference walk in AbstractSource::prepareDataHierarchy() as an array.
- Expect the docblock mismatch in AdapterInterfaceFactory, where Mago reads ServiceManager::get('config') as an object.
- Drop two pragmas and a null coalesce that 1.62.0 reports as unused.
- Remove 16 outdated analyzer baseline entries.
@simon-mundy simon-mundy self-assigned this Dec 1, 2026
@simon-mundy simon-mundy added bug Something isn't working qa Improvements in quality assurance of the project labels Dec 1, 2026
@github-project-automation github-project-automation Bot moved this to Todo in @phpdb Dec 1, 2026
@simon-mundy simon-mundy added this to the 0.6.0 milestone Dec 1, 2026
@simon-mundy
simon-mundy requested a review from tyrsson December 1, 2026 01:26
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Mago 1.62.0 compatibility update.

No open issues 🎉

What changed in this PR

Updates phpdb for Mago 1.62.0 to address formatter and analyzer failures blocking ongoing pull requests, including Infection’s static-analysis step.

Changes:

  • Applies formatter-only alignment and wrapping changes across source and test files.
  • Adjusts type annotations and analyzer expectations, removes unused suppressions, and simplifies the profiler’s last-entry lookup.
  • Removes outdated analyzer baseline entries and reduces resolved issue counts.
File Description
test/​unit/​Sql/​SelectTest.php Aligns SQL fixture assignments.
test/​unit/​Sql/​AbstractSqlFunctionalTestCase.php Aligns expected SQL array entries.
test/​unit/​Adapter/​Driver/​Pdo/​TestAsset/​TestConnection.php Aligns DSN match arms.
src/​TableGateway/​TableGateway.php Aligns feature-selection match arms.
src/​Sql/​Select.php Aligns reset and column-alias match arms.
src/​Sql/​Predicate/​PredicateSet.php Aligns predicate-construction match arms.
src/​Sql/​Predicate/​Operator.php Aligns operand-conversion match arms.
src/​Sql/​Predicate/​In.php Aligns value-set match arms.
src/​Sql/​Predicate/​CustomSpecification.php Reformats exception-call indentation.
src/​Sql/​IdentifierShape.php Aligns identifier-shape match arms.
src/​Sql/​IdentifierPiece.php Aligns identifier-piece match arms.
src/​Sql/​Expression.php Aligns parameter-conversion match arms.
src/​Sql/​Ddl/​CreateTable.php Aligns table-option match arms.
src/​Sql/​Ddl/​Column/​AbstractPrecisionColumn.php Aligns precision-expression match arms.
src/​Sql/​Ddl/​AlterTable.php Aligns table-option match arms.
src/​Sql/​AbstractSql.php Reformats expression, join, and exception handling.
src/​ResultSet/​RowPrototypeResultSetInterface.php Wraps the setter signature without changing its types.
src/​ResultSet/​AbstractResultSet.php Aligns field-count match arms.
src/​Metadata/​Source/​AbstractSource.php Annotates the reference walk as an array and removes an unused suppression.
src/​Container/​AdapterInterfaceFactory.php Documents and suppresses two config-service inference diagnostics.
src/​Adapter/​Profiler/​Profiler.php Removes redundant null coalescing from the last-profile lookup.
src/​Adapter/​ParameterContainer.php Removes an unused suppression and aligns match arms.
src/​Adapter/​Driver/​Pdo/​Statement.php Aligns PDO parameter-type match arms.
src/​Adapter/​Driver/​Pdo/​Result.php Aligns row-count match arms.
src/​Adapter/​Adapter.php Aligns helper-selection match arms.
analyzer-baseline.toml Removes obsolete diagnostics and reduces resolved issue counts.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in @phpdb Dec 1, 2026
@simon-mundy
simon-mundy merged commit 476574e into php-db:0.6.x Dec 1, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in @phpdb Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working qa Improvements in quality assurance of the project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants